﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.Common;
using TianShiProject.Models.Shen.TransportContracts;
using Volo.Abp.Application.Services;

namespace TianShiProject.Shen.TransportContractShens
{
    public class TransportContractShenService : ApplicationService
    {
        private readonly ITransportContractShenRepository _transportContractShenRepository;
        public TransportContractShenService(ITransportContractShenRepository transportContractShenRepository)
        {
            _transportContractShenRepository = transportContractShenRepository;
        }
        /// <summary>
        /// 提交审批
        /// </summary>
        /// <param name="transportContractShenDto"></param>
        /// <param name="loginname"></param>
        /// <param name="loginid"></param>
        /// <returns></returns>
        public async Task<int> PostAddTransportContract(TransportContractShenDto transportContractShenDto, string loginname, int? loginid)
        {
            return await _transportContractShenRepository.PostAddTransportContract(transportContractShenDto, loginname, loginid);
        }
        /// <summary>
        /// 显示审批
        /// </summary>
        /// <param name="title"></param>
        /// <param name="danwei"></param>
        /// <param name="fuzeren"></param>
        /// <param name="jingbanren"></param>
        /// <param name="qianding"></param>
        /// <returns></returns>
        public async Task<PageResponse<TransportContractShenDto>> GetShowTransportContract(string title, string danwei, string fuzeren, string jingbanren, DateTime? qianding, int pageindex = 1, int pagesize = 3)
        {
            return await _transportContractShenRepository.GetShowTransportContract(title, danwei, fuzeren, jingbanren, qianding, pageindex, pagesize);
        }
        /// <summary>
        /// 待审批显示
        /// </summary>
        /// <param name="title"></param>
        /// <param name="danwei"></param>
        /// <param name="fuzeren"></param>
        /// <param name="jingbanren"></param>
        /// <param name="qianding"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<TransportContractShenDto>> GetDaiTransportContract(string title, string danwei, string fuzeren, string jingbanren, DateTime? qianding, int pageindex = 1, int pagesize = 3)
        {
            return await _transportContractShenRepository.GetDaiTransportContract(title, danwei, fuzeren, jingbanren, qianding, pageindex, pagesize);
        }
        /// <summary>
        /// 已审批显示
        /// </summary>
        /// <param name="title"></param>
        /// <param name="danwei"></param>
        /// <param name="fuzeren"></param>
        /// <param name="jingbanren"></param>
        /// <param name="qianding"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<TransportContractShenDto>> GetYiTransportContract(string title, string danwei, string fuzeren, string jingbanren, DateTime? qianding, int pageindex = 1, int pagesize = 3)
        {
            return await _transportContractShenRepository.GetYiTransportContract(title, danwei, fuzeren, jingbanren, qianding, pageindex, pagesize);
        }
        /// <summary>
        /// 审批通过
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> PutTongTransportContract(Guid id)
        {
            return await _transportContractShenRepository.PutTongTransportContract(id);
        }
        /// <summary>
        /// 审批拒绝
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> PutJuTransportContract(Guid id)
        {
            return await _transportContractShenRepository.PutJuTransportContract(id);
        }
    }
}
